package com.ckzp.jfinal.weixin.controller;

import com.ckzp.jfinal.base.BaseController;
import com.ckzp.jfinal.base.PageSearch;
import com.ckzp.jfinal.form.FormData;
import com.ckzp.jfinal.interceptor.Admins;
import com.ckzp.jfinal.weixin.model.WxMember;
import com.ckzp.plugins.layui.LayuiData;
import com.ckzp.weixin.MediaTool;
import com.jfinal.plugin.activerecord.Page;

import java.util.List;

/**
 * Created by 51594 on 2023/4/10.
 */
public class WxMediaController extends BaseController {

    @Admins(roles = "weixin", name = "默认", log = false)
    public void index() {
        renderText("默认");
    }


    /**
     * 列表
     */
    @Admins(roles = "weixin", name = "列表PAGE", log = false)
    public void WxMediaImageList() {
        FormData fd = FormData.dao();
        fd.addData("upload_url", MediaTool.getMediaUploadUrl());
        setAttr("form", fd);
        render("WxMediaImageList.html");
    }


    /**
     * 微信用户数据查询API
     */
    @Admins(roles = "weixin", name = "微信媒体查询API", log = false)
    public void WxMediaListDataApi() {
        renderJson(MediaTool.getMediaList(getPara("type"), getPage(), getLimit()));
    }
}
